package com.ghost.alibabaghost.api.model.projects;

import com.ghost.alibabaghost.dao.dataobject.projects.ProjectDO;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author yaolisheng
 * @version 1.0
 * @date 2022/1/18 11:30
 */
public class ProjectModel extends ProjectDO {

    private String createTimeStr;

    public String getCreateTimeStr() {
        String strDateFormat = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
        if (this.getCreateTime() != null)
            return sdf.format(this.getCreateTime());
        return null;
    }

    public void setCreateTimeStr() {
        String strDateFormat = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
        Date createTime = this.getCreateTime();
        if (createTime != null)
            this.createTimeStr = sdf.format(createTime);
    }
}
